services:
  flask1:
    build: .
#    image: python:3.9
#    volumes:
#      - /comp/app1/
#    command: COPY app.py /app.py
#    expose:
#      - 5000
    ports:
      - "5002:5002"

    volumes:
      - ./app.py:/app.py
#      - ./add_host_entry.sh:/add_host_entry.sh

#    command: bash -c "./add_host_entry.sh"

    #command: python app.py
    networks:
      - internal
  app1:
    build: ./app1
    ports:
      - "5001:5001"
#  flask2:
#    image: python:3.9
#    volumes:
#      - /comp/app2/
#    command: python app.py
#    networks:
#      - internal

#  load_balancer:
#    image: nginx:latest
#    volumes:
#      - ./nginx
#    ports:
#      - "8080:80"
 #   networks:
#      - internal
  web:
    build:
      context: ./conf
    #command: gunicorn --bind 0.0.0.0:5000 manage:app\
    #command: gunicorn --certfile=cert.pem --keyfile=key.pem -b flask.com:5000 app:app
  #  ports:
  #    - "5000:5000"
    volumes:
      - ./cert.pem:/app/cert.pem
      - ./key.pem:/app/key.pem
      - ./entrypoint.sh:/app/entrypoint.sh
    entrypoint: /entrypoint.sh
    command: ["gunicorn", "--certfile=cert.pem", "--keyfile=key.pem", "-b", "flask.com:5000", "app:app"]
#    depends_on:
#      - app1

  nginx:
    build: ./conf
    ports:
        - "8000:80"
    depends_on:
        - app1


#    image: nginx:latest
#   build: .
#    depends_on:
#      - db
#    volumes:
    #  - ./conf/:/etc/nginx/nginx.conf
    #volumes:
 #     - static_volume:/static
#    ports:
#      - "80:80"
    networks:
      - internal

volumes:
  static_volume:


networks:
  internal:
